//
//  DetailViewController.m
//  UI08_homework(通讯录)
//
//  Created by Hanlingyu on 16/7/25.
//  Copyright © 2016年 ltq. All rights reserved.
//

#import "DetailViewController.h"

@interface DetailViewController ()

@end

@implementation DetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    NSArray *labelArray = @[@"姓名", @"性别", @"年龄", @"电话号码"];
    
    for (int i = 0; i < 4; i++) {
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 40)];
        label.center = CGPointMake(60, 100 + i * 50);
        label.backgroundColor = [UIColor lightGrayColor];
        label.layer.cornerRadius = 10;
        label.layer.masksToBounds = YES;
        label.textAlignment = 1;
        label.text = labelArray[i];
        [self.view addSubview:label];
    }
    
    for (int i = 0; i < 4; i++) {
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 40)];
        label.center = CGPointMake(self.view.bounds.size.width / 3 * 2, 100 + i * 50);
        label.backgroundColor = [UIColor whiteColor];
        label.textAlignment = 1;
        label.text = labelArray[i];
        label.tag = 1000 + i;
        [self.view addSubview:label];
    }
    self.nameLabel = [self.view viewWithTag:1000];
//    _nameLabel.text = self.studentDic[@"name"];
    _nameLabel.text = self.person.name;

    self.genderLabel = [self.view viewWithTag:1001];
//    _genderLabel.text = self.studentDic[@"gender"];
    _genderLabel.text = self.person.gender;
    self.ageLabel = [self.view viewWithTag:1002];
//    _ageLabel.text = [NSString stringWithFormat:@"%@", self.studentDic[@"age"]];
    _ageLabel.text = [NSString stringWithFormat:@"%@", self.person.age];

    self.phoneNumberLabel = [self.view viewWithTag:1003];
//    _phoneNumberLabel.text = self.studentDic[@"phoneNumber"];
    _phoneNumberLabel.text = [NSString stringWithFormat:@"%@", self.person.phoneNumber];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
